This stack shows a quick and very dirty way to get HyperCard to send a message when the user presses a key (other than return, tab, and the arrow keys). It doesn't work for number keys, and it probably isn't right for some applications, but it's simple and will probably work in many cases.
The basic idea is that there is an idle handler in the background script that looks in the message box and grabs whatever is there. Then, for each keystroke, it
generates the event "key" with the char that the user pressed as a parameter.
The trick is how to deal with the message box. It looks like the message box is hidden, but in point of fact you can't have the message box hidden because (as far as I can tell) whenever you put something into the message box, HyperCard shows it. So I have it visible, but offscreen.
The key-caps-like thing to the left is just a sample of what you can do with this technique.